<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org/">
	<head>
		<meta charset="utf-8">
		<title>药品采购单</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" th:href="@{/layuiadmin/layui/css/layui.css}" media="all">
	</head>
	<body>
		<!-- 相对于from表单 -->
		<div class="layui-form layui-form-pane" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">编号</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_id" th:value="${dp!=null?dp.dp_id:''}" readonly="readonly" placeholder="不可自定义"
					 autocomplete="off" class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">药品</label>
				<div class="layui-input-block">
					<select name="dp_drugid" lay-verify="required">
						<option value="">未选择</option>
						<option th:each="drug:${drugs}" th:value="${drug.drugDict_id}" th:selected="${dp!=null?drug.drugDict_id==dp.dp_drugid:false}">[[${drug.drugDict_name}]]</option>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">预计数量</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_num" th:value="${dp!=null ? dp.dp_num : ''}" lay-verify="gtZero" placeholder="请输入预计购入数量"
					 autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">预计单价</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_price" th:value="${dp!=null ? dp.dp_price : ''}" lay-verify="gtZeroPointZero1" placeholder="请输入预计购入单价"
					 autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">提交人id</label>
				<div class="layui-input-inline">
					<input type="hidden" name="dp_applicantid-" th:value="${dp!=null ? dp.dp_applicantid : ''}">
					<input type="text" name="applicant.realname" th:value="${dp!=null ? dp.applicant.realname : ''}" disabled="disabled" placeholder="不可自定义"
					 autocomplete="off" class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">提交时间</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_createtime-" th:value="${dp!=null ? #dates.format(dp.dp_createtime,'yyyy-MM-dd HH:mm:ss') : ''}" id="dp_createtime"
					  disabled="disabled" placeholder="不可自定义" class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">申请状态</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_state-" th:value="${dp!=null ? dp.dp_state : ''}" disabled="disabled" placeholder="不可自定义" autocomplete="off"
					 class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">确认人id</label>
				<div class="layui-input-inline">
					<input type="hidden" name="dp_confirmid-" th:value="${dp!=null ? dp.dp_confirmid : ''}">
					<input type="text" name="confirm.realname" th:value="${dp!=null&&dp.confirm!=null ? dp.confirm.realname : ''}" disabled="disabled" placeholder="未确认"
					 autocomplete="off" class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item" th:hidden="${dp==null?true:false}">
				<label class="layui-form-label">结束时间</label>
				<div class="layui-input-inline">
					<input type="text" name="dp_endtime-" th:value="${dp!=null ? #dates.format(dp.dp_endtime,'yyyy-MM-dd HH:mm:ss') : ''}" id="dp_endtime" disabled="disabled" placeholder="未确认"
					 class="layui-input layui-disabled">
				</div>
			</div>
			<div class="layui-form-item layui-hide">
				<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				<input type="button" lay-submit lay-filter="LAY-drugpurchase-front-submit" id="LAY-drugpurchase-front-submit" value="确认">
			</div>
		</div>
		<!-- 引入layui框架 -->
		<script th:src="@{/layuiadmin/layui/layui.js}"></script>
		<!-- 引入公共layui代码 -->
		<script type="text/javascript" th:src="@{/public/warehouse/publicsetting.js}"></script>
		<script>
			//启动layui语法：config全局配置
			layui.config({
				base: '[[@{/layuiadmin/}]]' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index', 'form', 'upload'], function() {//启用哪些组件
				//生成标签的对应对象
				var $ = layui.$,
					form = layui.form,
					upload = layui.upload;
				//不知道是什么
				upload.render({
					elem: '#layuiadmin-upload-useradmin',
					url: layui.setter.base + 'json/upload/demo.js',
					accept: 'images',
					method: 'get',
					acceptMime: 'image/*',
					done: function(res) {
						$(this.item).prev("div").children("input").val(res.data.src)
					}
				});
			})
		</script>
	</body>
</html>
